package com.bwie.controller;

import com.bwie.pojo.Periods;
import com.bwie.pojo.Repay;
import com.bwie.pojo.Time;
import com.bwie.pojo.Type;
import com.bwie.service.PeriodsService;
import com.bwie.service.RepayService;
import com.bwie.service.TimeService;
import com.bwie.service.TypeService;
import com.bwie.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 国兴越
 * @version 1.0
 * Create by
 */
@RestController
@RequestMapping("dictionary")
public class DictionaryController {


    @Autowired
    PeriodsService periodsService;


    @Autowired
    RepayService repayService;


    @Autowired
    TimeService timeService;

    @Autowired
    TypeService typeService;


    @PostMapping("/periodsList")
    public R perlist(){

        List<Periods> list = periodsService.list();

        return R.ok().message("列表查询成功").data("list",list);

    }

    @PostMapping("/repayList")
    public R repay(){

        List<Repay> list = repayService.list();

        return R.ok().message("列表查询成功").data("list",list);

    }

    @PostMapping("/timeList")
    public R timelist(){

        List<Time> list = timeService.list();

        return R.ok().message("列表查询成功").data("list",list);

    }
    @PostMapping("/typeList")
    public R typelist(){

        List<Type> list = typeService.list();

        return R.ok().message("列表查询成功").data("list",list);

    }










}
